﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CPPEI.Coolzon.Core.Data;

namespace CPPEI.Coolzon.Core.Repositories
{
    public interface IAssignedPrivilegeRepository
    {
        PagedList<AssignedPrivilege> GetAssignedPrivilegeList(DbContext context, int start, int limit);

        bool CreateAssignedPrivilege(DbContext context, AssignedPrivilege assignedPrivilege);

        bool RemoveAssignedPrivilege(DbContext context, AssignedPrivilege assignedPrivilege);

        bool RemoveAssignedPrivilege(DbContext context, Guid objectId);

        bool UpdateAssignedPrivilege(DbContext context, AssignedPrivilege assignedPrivilege);

        /// <summary>
        /// 通过assignedPrivilegeId获取分配权限对象
        /// </summary>
        /// <param name="context"></param>
        /// <param name="assignedPrivilegeId"></param>
        /// <returns></returns>
        AssignedPrivilege GetAssignedPrivilege(DbContext context, Guid assignedPrivilegeId);

        /// <summary>
        /// 通过objectId和privilegeId获取分配权限对象
        /// </summary>
        /// <param name="context"></param>
        /// <param name="objectId"></param>
        /// <param name="privilegeId"></param>
        /// <returns></returns>
        AssignedPrivilege GetAssignedPrivilege(DbContext context, Guid objectId, Guid privilegeId);

        /// <summary>
        /// 根据ObjectId获取权限列表
        /// </summary>
        /// <param name="context"></param>
        /// <param name="objectId"></param>
        /// <returns></returns>
        PagedList<AssignedPrivilege> GetAssignedPrivilegeByObjectId(DbContext context, Guid ObjectId);

        /// <summary>
        /// 根据ObjectId和ObjectType获取权限列表
        /// </summary>
        /// <param name="context"></param>
        /// <param name="objectId"></param>
        /// <param name="objectType"></param>
        /// <returns></returns>
        PagedList<AssignedPrivilege> GetAssignedPrivilegeByObjectId(DbContext context, Guid ObjectId, string ObjectType);

    }
}
